FROM tomcat
# Setting time zone
RUN cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone


RUN rm -rf /usr/local/tomcat/webapps/*
RUN mkdir -p /var/jenkins_home
ENV JENKINS_HOME=/var/jenkins_home

ENV GRADLE_USER_HOME=${JENKINS_HOME}/gradle
RUN mkdir -p ${GRADLE_USER_HOME}

ADD ./jenkins.war /usr/local/tomcat/webapps/ROOT.war
COPY ./init.gradle ${GRADLE_USER_HOME}/

EXPOSE 8080

VOLUME [ "/var/jenkins_home","/usr/local/tomcat/logs" ]
